Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor level2 to eliminate the input_sink and set all input defaults in the top group's configure method. #132

Merged
merged 7 commits into from
Feb 7, 2024

Conversation

Kenneth-T-Moore
Copy link
Member

Summary

Prior to this change, the level 2 interface handled setting the model's input defaults by a call to a utility function right before setup. Since at this point, it isn't possible to figure out what inputs are in the model, we called set_input_defaults on everything in the aircraft metadata. Unfortunately, if you promote an input that isn't in the model, OpenMDAO raises an error. Our original workaround was to create the "input_sink" component, which contained almost every variable in the metadata dictionary. This approach caused other problems that we have gradually discovered...

This PR is a re-implementation, where we delay calling set_input_defaults until the top group's configure method. At this point, we know all of our subsystem's inputs and can query them, so we no longer need the input_sink.

  1. Removed the "input_sink" component from the AviaryProblem interface.
  2. Implemented a custom top level group (AviaryGroup) with a configure method that handles setting the input defaults.
  3. Fixed a test that added an objective that didn't exist in the model.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

Copy link
Contributor

@jkirk5 jkirk5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! Should help clean up the n2 as well

Copy link
Member

@johnjasa johnjasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely slick stuff Ken, I love this!

@johnjasa johnjasa added this pull request to the merge queue Feb 7, 2024
Merged via the queue into OpenMDAO:main with commit ef46588 Feb 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants